package com.szrt.java.day20161230.demo03;

public class Student03 {

	private String name;
	private String idNum;
	private char sex;
	private int age;
	private String school;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		if(name.length() <= 4 && name.length() >= 2){
			this.name = name;
		}
	}
	
	public String getIdNum() {
		return idNum;
	}
	public void setIdNum(String idNum) {
		if(idNum.length() == 18){
			this.idNum = idNum;
		}
	}
	
	public char getSex() {
		return sex;
	}
	public void setSex(char sex) {
		if(sex == '男' || sex == '女'){
			this.sex = sex;
		}
	}
	
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		if(age >=1 && age <=130){
			this.age = age;
		}
	}
	
	public String getSchool() {
		return school;
	}
	public void setSchool(String school) {
		if(!school.equals("")){
			this.school = school;
		}
	}
	@Override
	public String toString() {
		return "Student03 [name=" + name + ", idNum=" + idNum + ", sex=" + sex + ", age=" + age + ", school=" + school
				+ "]";
	}
	
	
	
}
